package com.mangguo.tingjian.account.rest;

import com.mangguo.tingjian.account.dto.DeptDto;
import com.mangguo.tingjian.common.Result;
import com.mangguo.tingjian.account.service.DeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {

    @Resource
    private DeptService deptService;

    @GetMapping("/all")
    public Result<List<DeptDto>> allRole(){
        return Result.success(deptService.findAllDept());
    }
}
